{% extends 'base.html' %}
{% load tags %}

{% block body %}
  <body>

    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container-fluid">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="http://127.0.0.1:8000/crm/">社团管理系统</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav navbar-right">
{#            <li><a href="http://v3.bootcss.com/examples/dashboard/#">Dashboard</a></li>#}
{#            <li><a href="http://v3.bootcss.com/examples/dashboard/#">Settings</a></li>#}
{#            <li><a href="http://v3.bootcss.com/examples/dashboard/#">Profile</a></li>#}
{#            <li><a href="http://v3.bootcss.com/examples/dashboard/#">{{ request.user.userprofile.name }}</a></li>#}
            <li class="dropdown">
              <a href="http://127.0.0.1:8000/admin/" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">{{ request.user.userprofile.name }} <span class="caret"></span></a>
              <ul class="dropdown-menu" role="menu">
                <li><a href="http://127.0.0.1:8000/admin/">后台管理</a></li>
                <li><a href="http://127.0.0.1:8000/admin/password_change/">修改密码</a></li>
                <li><a href="{% url 'acc_logout' %}">注销</a></li>
              </ul>
            </li>
          </ul>
{#            查找#}
{#          <form class="navbar-form navbar-right">#}
{#            <input type="text" class="form-control" placeholder="Search...">#}
{#          </form>#}
        </div>
      </div>
    </nav>

    <div class="container " style="margin: 50px;width: auto">
        {% block container %}
        <div class="row">
            <div class="panel panel-info">
              <div class="panel-heading">
                <h3 class="panel-title">数据管理</h3>
              </div>
              <div class="panel-body">
{#                {{ table_list }}#}
                  {% for app_name,app_tables in table_list.items %}
                      <table class="table table-hover">
                          <thead>
                            <tr>
                                <th>{{ app_name }}</th>
                            </tr>
                        </thead>
                        <tbody>
                            {% for table_name,admin in app_tables.items %}
                                <tr>
                                    <td>
                                        <a href="{% url 'table_objs' app_name table_name %}">
                                       {% render_app_name admin %}
                                        </a>
                                    </td>
{#                                    <td>add</td>#}
{#                                    <td>change</td>#}
                                </tr>
                            {% endfor %}
                        </tbody>
                      </table>
                  {% endfor %}
              </div>
            </div>
        </div>
        {% endblock %}
    </div>


</body>

{% endblock %}